In an Internet Protocol (IP) network or other packet-switched network, packets are frequently transmitted through many intermediate routers between a source node and a destination node. At each of these intermediate routers traversed in the path, the next-hop in the path to the destination node is determined. The next-hop is commonly selected from a plurality of potential next-hop routers based upon the routing tables compiled at the node.
In routers enabled with the Open Shortest-Path First (OSPF) protocol, for example, the next-hop selected is associated with the “shortest path” to the destination node. The shortest path is generally the least costly path measured as a function of one or more metrics. Routers exchange these cost metrics using link-state advertisements that are flooded through the network. Upon receipt of a link-state advertisement, the recipient router retains a copy in its link-state database and then propagates the update to other routers.
After the link-state database of each router is completed, the routers generate a Shortest Path Tree to all destinations nodes using Dijkstra's algorithm. The destinations nodes, the associated cost, and the next-hop to reach those destinations form the routing table.
The cost may be based on bandwidth, the expense of a leased line, or administrator assignment, for example. The bandwidth of an interface represents the overhead required to send packets across an interface, and the associated bandwidth cost is inversely proportional to the bandwidth of that interface. The cost of a path between the source and destination nodes is then the sum of the costs associated for all the interfaces traversed between the source and destination nodes.
If the destination node is reachable through a plurality of interfaces, a router will generally transmit the packet toward the destination node using the interface associated with the minimal cost path. In some cases, however, multiple paths may have the same minimal path cost. While each of the associated interfaces may be used to transmit a packet to the destination with minimal cost, the router generally assigns a single interface from which to transmit all outbound packets of a flow to assure the packet order is preserved. A router may employ a round-robin scheme to assign each new outbound flow to one of the plurality of minimal equal-cost paths.
In a number of routers, the interface assigned to an outbound flow need not be the same as the interface of the corresponding inbound flow received. In some devices configured to perform “source learning” on network layer addresses, however, conflicts can occur if the outbound interface assigned is different than the interface on which inbound traffic from the same flow is received. There is therefore a need to reconcile inconsistencies between the inbound interface on which traffic is learned and the outbound interface to which outbound traffic is assigned while still providing the port assignment scheme flexibility needed to perform load balancing, for example.